package com.starwalking.starwalkingaiagent.demo.invoke;

import jakarta.annotation.Resource;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * SpringAI
 */
//@Component
//public class SpringAiInvoke implements CommandLineRunner {
////    @Resource
////    private ChatModel dashScopeChatModel;
////    @Override
////    public void run(String... args) throws Exception {
////        AssistantMessage assistantMessage = dashScopeChatModel.call(new Prompt("你好，我是starwalking")).getResult().getOutput();
////        System.out.println(assistantMessage.getText());
////    }
//
//    @Resource
//    private ChatClient chatClient;
//
//    @Override
//    public void run(String... args) throws Exception {
//        ChatResponse response = chatClient
//                .prompt().user("我的女朋友生气了怎么办").call().chatResponse();
//        System.out.println(response);
//    }
//
//
//}
